package com.gjzhao.fmmall.service.fallback;

import com.gjzhao.fmmall.entity.Orders;
import com.gjzhao.fmmall.service.feign.ApiOrderClient;
import com.gjzhao.fmmall.vo.RespResultVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @Description: 订单服务 服务降级类
 * @Author: gjzhao
 * @Date Created in 2022-02-09 10:48 下午
 */
@Component //交给spring进行管理
public class ApiOrderFallBack implements ApiOrderClient { //必须实现feign客户端


    private Logger logger = LoggerFactory.getLogger(getClass());


    @Override
    public RespResultVO add(Orders order, String cartIds) {
        logger.info("-----add订单添加服务进行降级----");
        return RespResultVO.failed("网络故障，订单添加失败[服务消费者进行降级服务]");
    }

    @Override
    public RespResultVO getOrder(String orderId) {
        logger.info("-----getOrder订单查询服务进行降级----");
        return RespResultVO.failed("网络故障，订单查询失败[服务消费者进行降级服务]");
    }

}
